# 获取订单列表 - 过滤函数
def filter_order_list(order_list, **kwargs):
    # 过滤订单列表
    filtered_order_list = []
    for order in order_list:
        # 检查订单是否符合过滤条件
        filtered_order_list.append({
            "Title": order.get("Title"),
            "SerialNo": order.get("SerialNo"),
            "Price": order.get("Price"),
            "Ensure1": order.get("Ensure1"),
            "Ensure2": order.get("Ensure2"),
            "TimeLimit": order.get("TimeLimit"),
            "Create": order.get("Create"),
            "Game": order.get("Game"),
            "Zone": order.get("Zone"),
            "Server": order.get("Server"),
        })
    return filtered_order_list



# 接受订单 - 过滤函数
def filter_receive_order(order_detail):
    # 过滤订单详情
    code =  order_detail.get("Result")
    if code == 1:
        code = 0
    
    return {
        "Err": order_detail.get("Err"),
        "Result":code, # 只有等于1时才是成功
    }


# 获取订单详情 - 过滤函数
def filter_order_detail(order_detail):
    data = {
        "SerialNo": order_detail.get("SerialNo"), # 订单ID
        "Title": order_detail.get("Title"), # 订单标题
        "GameAcc": order_detail.get("GameAcc"), # 游戏账号
        "GamePass": order_detail.get("GamePass"), # 游戏密码
        "GameMobile": order_detail.get("GameMobile"), # 游戏手机号
        "Game": order_detail.get("Game"), # 游戏名称
        "Zone": order_detail.get("Zone"), # 区服名称
        "Actor": order_detail.get("Actor"), # 角色名称
        "LeaveTime": order_detail.get("LeaveTime"), # 结束时间
    }
    return data


# 接受订单 - 过滤函数
def filter_accept_order(order_detail):
    # 过滤订单详情
    code =  order_detail.get("Result")
    if code == 1:
        code = 0
    
    return {
        "Err": order_detail.get("Err"),
        "Result":code, # 只有等于1时才是成功
    }